/*
Navicat SQL Server Data Transfer

Source Server         : sharpsln
Source Server Version : 110000
Source Host           : taketry:1433
Source Database       : SharpSln
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 110000
File Encoding         : 65001

Date: 2018-03-19 09:55:14
*/


-- ----------------------------
-- Table structure for SYS_USER
-- ----------------------------
DROP TABLE [dbo].[SYS_USER]
GO
CREATE TABLE [dbo].[SYS_USER] (
[ID] uniqueidentifier NOT NULL ,
[LOGINNAME] nvarchar(100) NOT NULL ,
[PASSWD] varchar(100) NULL ,
[REALNAME] nvarchar(50) NULL ,
[NICKNAME] nvarchar(50) NULL ,
[GENDER] int NOT NULL DEFAULT ((0)) ,
[BIRTHDAY] datetime NULL ,
[PHONE] varchar(50) NULL ,
[QQ] varchar(50) NULL ,
[EMAIL] varchar(50) NULL ,
[WECHAT] varchar(50) NULL ,
[STATE] int NOT NULL DEFAULT ((0)) ,
[ADDED] datetime NOT NULL DEFAULT (getdate()) ,
[ADDEDUID] varchar(50) NULL ,
[LASTMODIFIED] datetime NOT NULL DEFAULT (getdate()) ,
[LASTMODIFIEDUID] varchar(50) NULL 
)


GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
NULL, NULL)) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'系统用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'系统用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'ID')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'主键ID'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'ID'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'主键ID'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'ID'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'LOGINNAME')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'登录名'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'LOGINNAME'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'登录名'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'LOGINNAME'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'PASSWD')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'密码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'PASSWD'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'密码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'PASSWD'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'REALNAME')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'真实名'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'REALNAME'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'真实名'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'REALNAME'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'NICKNAME')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'昵称'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'NICKNAME'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'昵称'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'NICKNAME'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'GENDER')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'性别（0男，1女）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'GENDER'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'性别（0男，1女）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'GENDER'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'BIRTHDAY')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'生日'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'BIRTHDAY'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'生日'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'BIRTHDAY'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'PHONE')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'电话'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'PHONE'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'电话'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'PHONE'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'QQ')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'Q号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'QQ'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'Q号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'QQ'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'EMAIL')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'邮箱地址'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'EMAIL'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'邮箱地址'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'EMAIL'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'WECHAT')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'微信号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'WECHAT'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'微信号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'WECHAT'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'STATE')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'状态(0启用1禁用)'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'STATE'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'状态(0启用1禁用)'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'STATE'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'ADDED')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'添加时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'ADDED'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'添加时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'ADDED'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'ADDEDUID')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'添加用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'ADDEDUID'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'添加用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'ADDEDUID'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'LASTMODIFIED')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'最后修改时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIED'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'最后修改时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIED'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_USER', 
'COLUMN', N'LASTMODIFIEDUID')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'最后修改用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIEDUID'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'最后修改用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_USER'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIEDUID'
GO

-- ----------------------------
-- Records of SYS_USER
-- ----------------------------
INSERT INTO [dbo].[SYS_USER] ([ID], [LOGINNAME], [PASSWD], [REALNAME], [NICKNAME], [GENDER], [BIRTHDAY], [PHONE], [QQ], [EMAIL], [WECHAT], [STATE], [ADDED], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'4E60CFC5-5ED3-47C2-9505-B307014A7BFC', N'Admin', N'123456', null, null, N'0', null, N'88255298', null, N'lztkdr@qq.com', null, N'0', N'2017-11-13 14:15:57.537', null, N'2017-11-13 14:15:57.537', null)
GO
GO

-- ----------------------------
-- Indexes structure for table SYS_USER
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table SYS_USER
-- ----------------------------
ALTER TABLE [dbo].[SYS_USER] ADD PRIMARY KEY ([ID])
GO

-- ----------------------------
-- Uniques structure for table SYS_USER
-- ----------------------------
ALTER TABLE [dbo].[SYS_USER] ADD UNIQUE ([LOGINNAME] ASC)
GO
